import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'node:path'

import path from "path"
import { transpile } from 'typescript'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base:'./',
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./"),
    }
  },
  server:{
    port:5000,
    proxy:{
      "/api":{
        target:'localhost:8080',
        changeOrigin:true,
        rewrite:(path)=>path.replace(/^\/api/,''),
        ws:true
      }
    }
  },

})
